package com.Lyy.Service;

import com.Lyy.Dao.BookMapper;
import com.Lyy.Entity.Book;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;
@Component
@Service
public class BookServiceImpl implements BookService {
    @Autowired
    private BookMapper bookMapper;
    @Override
    public List<Book> SelectBookAll() {
        return bookMapper.SelectBookAll();
    }

    @Override
    public List<Book> SelectBookByName(String bookName) {
        return bookMapper.SelectBookByName(bookName);
    }

    @Override
    public Book SelectBookById(int id) {
        return bookMapper.SelectBookById(id);
    }

    @Override
    public int UpdateBook(Book book) {
        return bookMapper.UpdateBook(book);
    }

    @Override
    public int DeleteBook(int id) {
        return bookMapper.DeleteBook(id);
    }

    @Override
    public int InsertBook(Book book) {
        return bookMapper.InsertBook(book);
    }
}
